define([
  'jquery',
  'underscore',
  'backbone',
  'views/home',
  'views/users/list',
  'views/editor'
],function($,_,Backbone,HomeView,UserListView,EditorView){
  
  var AppRouter = Backbone.Router.extend({
    routes:{
      'users':'showUsers',
      'editor':'allEditor',
      '*actions':'defaultAction'
    }
  });

  var init = function(){

    var app_router = new AppRouter;

    app_router.on('route:showUsers',function(){
      var userListView = new UserListView();
      userListView.render();
    });

    app_router.on('route:defaultAction',function(actions){
      var homeView = new HomeView();
      homeView.render();
    });

    app_router.on('route:allEditor',function(){
      var editorView = new EditorView();
      editorView.render();
    });

    Backbone.history.start();
  }

  return {init:init};

});